package com.ruoyi.oar.api.util;


import com.github.pagehelper.util.StringUtil;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class CommUtil {

    public static String assembleSecret(String mySecret) {
        if (StringUtil.isEmpty(mySecret)) {
            return "";
        }
        if (mySecret.length() == 24) {
            return mySecret;
        } else if (mySecret.length() >= 24) {
            mySecret = mySecret.substring(0, 24);
        } else {
            int left = 24 - mySecret.length();
            String str = "";
            for (int i = 0; i < left; i++) {
                str += "x";
            }
            mySecret = mySecret + str;
        }
        return mySecret;
    }

}
